package com.hc.service.impl;

import com.hc.bean.Pager;
import com.hc.bean.UserInfo;
import com.hc.dao.UserInfoDao;
import com.hc.service.UserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class UserInfoServiceImpl implements UserInfoService {
    @Autowired
    private UserInfoDao userInfoDao;

    @Override
    public List<UserInfo> getUserInfo(String name, Pager pager) {
        return userInfoDao.getUserInfo(name,pager);
    }

    @Override
    public int getUserInfoCount(String name) {
        return userInfoDao.getUserInfoCount(name);
    }

    @Override
    public Boolean setIsEnableUser(int status, String ids) {
        if(userInfoDao.setIsEnableUser(status,ids)>0)
            return true;
        return false;
    }

    @Override
    public List<UserInfo> getValidUser() {
        return userInfoDao.getValidUser();
    }

    @Override
    public List<UserInfo> getOrderUser() {
        return userInfoDao.getOrderUser();
    }

    @Override
    public Boolean addUser(UserInfo userInfo) {
        if(userInfoDao.addUser(userInfo)>0)
            return true;
        return false;
    }
}
